/******************************************************************************
 * Copyright 2022 The Airos Authors. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *****************************************************************************/

#pragma once

static const double g_color_table[256][3] = {
    {0, 0, 0.5156},           {0, 0, 0.5313},
    {0, 0, 0.5469},           {0, 0, 0.5625},
    {0, 0, 0.5781},           {0, 0, 0.5938},
    {0, 0, 0.6094},           {0, 0, 0.6250},
    {0, 0, 0.6406},           {0, 0, 0.6563},
    {0, 0, 0.6719},           {0, 0, 0.6875},
    {0, 0, 0.7031},           {0, 0, 0.7188},
    {0, 0, 0.7344},           {0, 0, 0.7500},
    {0, 0, 0.7656},           {0, 0, 0.7813},
    {0, 0, 0.7969},           {0, 0, 0.8125},
    {0, 0, 0.8281},           {0, 0, 0.8438},
    {0, 0, 0.8594},           {0, 0, 0.8750},
    {0, 0, 0.8906},           {0, 0, 0.9063},
    {0, 0, 0.9219},           {0, 0, 0.9375},
    {0, 0, 0.9531},           {0, 0, 0.9688},
    {0, 0, 0.9844},           {0, 0, 1.0000},
    {0, 0.0156, 1.0000},      {0, 0.0313, 1.0000},
    {0, 0.0469, 1.0000},      {0, 0.0625, 1.0000},
    {0, 0.0781, 1.0000},      {0, 0.0938, 1.0000},
    {0, 0.1094, 1.0000},      {0, 0.1250, 1.0000},
    {0, 0.1406, 1.0000},      {0, 0.1563, 1.0000},
    {0, 0.1719, 1.0000},      {0, 0.1875, 1.0000},
    {0, 0.2031, 1.0000},      {0, 0.2188, 1.0000},
    {0, 0.2344, 1.0000},      {0, 0.2500, 1.0000},
    {0, 0.2656, 1.0000},      {0, 0.2813, 1.0000},
    {0, 0.2969, 1.0000},      {0, 0.3125, 1.0000},
    {0, 0.3281, 1.0000},      {0, 0.3438, 1.0000},
    {0, 0.3594, 1.0000},      {0, 0.3750, 1.0000},
    {0, 0.3906, 1.0000},      {0, 0.4063, 1.0000},
    {0, 0.4219, 1.0000},      {0, 0.4375, 1.0000},
    {0, 0.4531, 1.0000},      {0, 0.4688, 1.0000},
    {0, 0.4844, 1.0000},      {0, 0.5000, 1.0000},
    {0, 0.5156, 1.0000},      {0, 0.5313, 1.0000},
    {0, 0.5469, 1.0000},      {0, 0.5625, 1.0000},
    {0, 0.5781, 1.0000},      {0, 0.5938, 1.0000},
    {0, 0.6094, 1.0000},      {0, 0.6250, 1.0000},
    {0, 0.6406, 1.0000},      {0, 0.6563, 1.0000},
    {0, 0.6719, 1.0000},      {0, 0.6875, 1.0000},
    {0, 0.7031, 1.0000},      {0, 0.7188, 1.0000},
    {0, 0.7344, 1.0000},      {0, 0.7500, 1.0000},
    {0, 0.7656, 1.0000},      {0, 0.7813, 1.0000},
    {0, 0.7969, 1.0000},      {0, 0.8125, 1.0000},
    {0, 0.8281, 1.0000},      {0, 0.8438, 1.0000},
    {0, 0.8594, 1.0000},      {0, 0.8750, 1.0000},
    {0, 0.8906, 1.0000},      {0, 0.9063, 1.0000},
    {0, 0.9219, 1.0000},      {0, 0.9375, 1.0000},
    {0, 0.9531, 1.0000},      {0, 0.9688, 1.0000},
    {0, 0.9844, 1.0000},      {0, 1.0000, 1.0000},
    {0.0156, 1.0000, 0.9844}, {0.0313, 1.0000, 0.9688},
    {0.0469, 1.0000, 0.9531}, {0.0625, 1.0000, 0.9375},
    {0.0781, 1.0000, 0.9219}, {0.0938, 1.0000, 0.9063},
    {0.1094, 1.0000, 0.8906}, {0.1250, 1.0000, 0.8750},
    {0.1406, 1.0000, 0.8594}, {0.1563, 1.0000, 0.8438},
    {0.1719, 1.0000, 0.8281}, {0.1875, 1.0000, 0.8125},
    {0.2031, 1.0000, 0.7969}, {0.2188, 1.0000, 0.7813},
    {0.2344, 1.0000, 0.7656}, {0.2500, 1.0000, 0.7500},
    {0.2656, 1.0000, 0.7344}, {0.2813, 1.0000, 0.7188},
    {0.2969, 1.0000, 0.7031}, {0.3125, 1.0000, 0.6875},
    {0.3281, 1.0000, 0.6719}, {0.3438, 1.0000, 0.6563},
    {0.3594, 1.0000, 0.6406}, {0.3750, 1.0000, 0.6250},
    {0.3906, 1.0000, 0.6094}, {0.4063, 1.0000, 0.5938},
    {0.4219, 1.0000, 0.5781}, {0.4375, 1.0000, 0.5625},
    {0.4531, 1.0000, 0.5469}, {0.4688, 1.0000, 0.5313},
    {0.4844, 1.0000, 0.5156}, {0.5000, 1.0000, 0.5000},
    {0.5156, 1.0000, 0.4844}, {0.5313, 1.0000, 0.4688},
    {0.5469, 1.0000, 0.4531}, {0.5625, 1.0000, 0.4375},
    {0.5781, 1.0000, 0.4219}, {0.5938, 1.0000, 0.4063},
    {0.6094, 1.0000, 0.3906}, {0.6250, 1.0000, 0.3750},
    {0.6406, 1.0000, 0.3594}, {0.6563, 1.0000, 0.3438},
    {0.6719, 1.0000, 0.3281}, {0.6875, 1.0000, 0.3125},
    {0.7031, 1.0000, 0.2969}, {0.7188, 1.0000, 0.2813},
    {0.7344, 1.0000, 0.2656}, {0.7500, 1.0000, 0.2500},
    {0.7656, 1.0000, 0.2344}, {0.7813, 1.0000, 0.2188},
    {0.7969, 1.0000, 0.2031}, {0.8125, 1.0000, 0.1875},
    {0.8281, 1.0000, 0.1719}, {0.8438, 1.0000, 0.1563},
    {0.8594, 1.0000, 0.1406}, {0.8750, 1.0000, 0.1250},
    {0.8906, 1.0000, 0.1094}, {0.9063, 1.0000, 0.0938},
    {0.9219, 1.0000, 0.0781}, {0.9375, 1.0000, 0.0625},
    {0.9531, 1.0000, 0.0469}, {0.9688, 1.0000, 0.0313},
    {0.9844, 1.0000, 0.0156}, {1.0000, 1.0000, 0},
    {1.0000, 0.9844, 0},      {1.0000, 0.9688, 0},
    {1.0000, 0.9531, 0},      {1.0000, 0.9375, 0},
    {1.0000, 0.9219, 0},      {1.0000, 0.9063, 0},
    {1.0000, 0.8906, 0},      {1.0000, 0.8750, 0},
    {1.0000, 0.8594, 0},      {1.0000, 0.8438, 0},
    {1.0000, 0.8281, 0},      {1.0000, 0.8125, 0},
    {1.0000, 0.7969, 0},      {1.0000, 0.7813, 0},
    {1.0000, 0.7656, 0},      {1.0000, 0.7500, 0},
    {1.0000, 0.7344, 0},      {1.0000, 0.7188, 0},
    {1.0000, 0.7031, 0},      {1.0000, 0.6875, 0},
    {1.0000, 0.6719, 0},      {1.0000, 0.6563, 0},
    {1.0000, 0.6406, 0},      {1.0000, 0.6250, 0},
    {1.0000, 0.6094, 0},      {1.0000, 0.5938, 0},
    {1.0000, 0.5781, 0},      {1.0000, 0.5625, 0},
    {1.0000, 0.5469, 0},      {1.0000, 0.5313, 0},
    {1.0000, 0.5156, 0},      {1.0000, 0.5000, 0},
    {1.0000, 0.4844, 0},      {1.0000, 0.4688, 0},
    {1.0000, 0.4531, 0},      {1.0000, 0.4375, 0},
    {1.0000, 0.4219, 0},      {1.0000, 0.4063, 0},
    {1.0000, 0.3906, 0},      {1.0000, 0.3750, 0},
    {1.0000, 0.3594, 0},      {1.0000, 0.3438, 0},
    {1.0000, 0.3281, 0},      {1.0000, 0.3125, 0},
    {1.0000, 0.2969, 0},      {1.0000, 0.2813, 0},
    {1.0000, 0.2656, 0},      {1.0000, 0.2500, 0},
    {1.0000, 0.2344, 0},      {1.0000, 0.2188, 0},
    {1.0000, 0.2031, 0},      {1.0000, 0.1875, 0},
    {1.0000, 0.1719, 0},      {1.0000, 0.1563, 0},
    {1.0000, 0.1406, 0},      {1.0000, 0.1250, 0},
    {1.0000, 0.1094, 0},      {1.0000, 0.0938, 0},
    {1.0000, 0.0781, 0},      {1.0000, 0.0625, 0},
    {1.0000, 0.0469, 0},      {1.0000, 0.0313, 0},
    {1.0000, 0.0156, 0},      {1.0000, 0, 0},
    {0.9844, 0, 0},           {0.9688, 0, 0},
    {0.9531, 0, 0},           {0.9375, 0, 0},
    {0.9219, 0, 0},           {0.9063, 0, 0},
    {0.8906, 0, 0},           {0.8750, 0, 0},
    {0.8594, 0, 0},           {0.8438, 0, 0},
    {0.8281, 0, 0},           {0.8125, 0, 0},
    {0.7969, 0, 0},           {0.7813, 0, 0},
    {0.7656, 0, 0},           {0.7500, 0, 0},
    {0.7344, 0, 0},           {0.7188, 0, 0},
    {0.7031, 0, 0},           {0.6875, 0, 0},
    {0.6719, 0, 0},           {0.6563, 0, 0},
    {0.6406, 0, 0},           {0.6250, 0, 0},
    {0.6094, 0, 0},           {0.5938, 0, 0},
    {0.5781, 0, 0},           {0.5625, 0, 0},
    {0.5469, 0, 0},           {0.5313, 0, 0},
    {0.5156, 0, 0},           {0.5000, 0, 0},
};
static const double hsv_color_table[255][3] = {
    {1.0000, 0, 0},      {1.0000, 0.0235, 0}, {1.0000, 0.0471, 0},
    {1.0000, 0.0706, 0}, {1.0000, 0.0941, 0}, {1.0000, 0.1176, 0},
    {1.0000, 0.1412, 0}, {1.0000, 0.1647, 0}, {1.0000, 0.1882, 0},
    {1.0000, 0.2118, 0}, {1.0000, 0.2353, 0}, {1.0000, 0.2588, 0},
    {1.0000, 0.2824, 0}, {1.0000, 0.3059, 0}, {1.0000, 0.3294, 0},
    {1.0000, 0.3529, 0}, {1.0000, 0.3765, 0}, {1.0000, 0.4000, 0},
    {1.0000, 0.4235, 0}, {1.0000, 0.4471, 0}, {1.0000, 0.4706, 0},
    {1.0000, 0.4941, 0}, {1.0000, 0.5176, 0}, {1.0000, 0.5412, 0},
    {1.0000, 0.5647, 0}, {1.0000, 0.5882, 0}, {1.0000, 0.6118, 0},
    {1.0000, 0.6353, 0}, {1.0000, 0.6588, 0}, {1.0000, 0.6824, 0},
    {1.0000, 0.7059, 0}, {1.0000, 0.7294, 0}, {1.0000, 0.7529, 0},
    {1.0000, 0.7765, 0}, {1.0000, 0.8000, 0}, {1.0000, 0.8235, 0},
    {1.0000, 0.8471, 0}, {1.0000, 0.8706, 0}, {1.0000, 0.8941, 0},
    {1.0000, 0.9176, 0}, {1.0000, 0.9412, 0}, {1.0000, 0.9647, 0},
    {1.0000, 0.9882, 0}, {0.9882, 1.0000, 0}, {0.9647, 1.0000, 0},
    {0.9412, 1.0000, 0}, {0.9176, 1.0000, 0}, {0.8941, 1.0000, 0},
    {0.8706, 1.0000, 0}, {0.8471, 1.0000, 0}, {0.8235, 1.0000, 0},
    {0.8000, 1.0000, 0}, {0.7765, 1.0000, 0}, {0.7529, 1.0000, 0},
    {0.7294, 1.0000, 0}, {0.7059, 1.0000, 0}, {0.6824, 1.0000, 0},
    {0.6588, 1.0000, 0}, {0.6353, 1.0000, 0}, {0.6118, 1.0000, 0},
    {0.5882, 1.0000, 0}, {0.5647, 1.0000, 0}, {0.5412, 1.0000, 0},
    {0.5176, 1.0000, 0}, {0.4941, 1.0000, 0}, {0.4706, 1.0000, 0},
    {0.4471, 1.0000, 0}, {0.4235, 1.0000, 0}, {0.4000, 1.0000, 0},
    {0.3765, 1.0000, 0}, {0.3529, 1.0000, 0}, {0.3294, 1.0000, 0},
    {0.3059, 1.0000, 0}, {0.2824, 1.0000, 0}, {0.2588, 1.0000, 0},
    {0.2353, 1.0000, 0}, {0.2118, 1.0000, 0}, {0.1882, 1.0000, 0},
    {0.1647, 1.0000, 0}, {0.1412, 1.0000, 0}, {0.1176, 1.0000, 0},
    {0.0941, 1.0000, 0}, {0.0706, 1.0000, 0}, {0.0471, 1.0000, 0},
    {0.0235, 1.0000, 0}, {0, 1.0000, 0},      {0, 1.0000, 0.0235},
    {0, 1.0000, 0.0471}, {0, 1.0000, 0.0706}, {0, 1.0000, 0.0941},
    {0, 1.0000, 0.1176}, {0, 1.0000, 0.1412}, {0, 1.0000, 0.1647},
    {0, 1.0000, 0.1882}, {0, 1.0000, 0.2118}, {0, 1.0000, 0.2353},
    {0, 1.0000, 0.2588}, {0, 1.0000, 0.2824}, {0, 1.0000, 0.3059},
    {0, 1.0000, 0.3294}, {0, 1.0000, 0.3529}, {0, 1.0000, 0.3765},
    {0, 1.0000, 0.4000}, {0, 1.0000, 0.4235}, {0, 1.0000, 0.4471},
    {0, 1.0000, 0.4706}, {0, 1.0000, 0.4941}, {0, 1.0000, 0.5176},
    {0, 1.0000, 0.5412}, {0, 1.0000, 0.5647}, {0, 1.0000, 0.5882},
    {0, 1.0000, 0.6118}, {0, 1.0000, 0.6353}, {0, 1.0000, 0.6588},
    {0, 1.0000, 0.6824}, {0, 1.0000, 0.7059}, {0, 1.0000, 0.7294},
    {0, 1.0000, 0.7529}, {0, 1.0000, 0.7765}, {0, 1.0000, 0.8000},
    {0, 1.0000, 0.8235}, {0, 1.0000, 0.8471}, {0, 1.0000, 0.8706},
    {0, 1.0000, 0.8941}, {0, 1.0000, 0.9176}, {0, 1.0000, 0.9412},
    {0, 1.0000, 0.9647}, {0, 1.0000, 0.9882}, {0, 0.9882, 1.0000},
    {0, 0.9647, 1.0000}, {0, 0.9412, 1.0000}, {0, 0.9176, 1.0000},
    {0, 0.8941, 1.0000}, {0, 0.8706, 1.0000}, {0, 0.8471, 1.0000},
    {0, 0.8235, 1.0000}, {0, 0.8000, 1.0000}, {0, 0.7765, 1.0000},
    {0, 0.7529, 1.0000}, {0, 0.7294, 1.0000}, {0, 0.7059, 1.0000},
    {0, 0.6824, 1.0000}, {0, 0.6588, 1.0000}, {0, 0.6353, 1.0000},
    {0, 0.6118, 1.0000}, {0, 0.5882, 1.0000}, {0, 0.5647, 1.0000},
    {0, 0.5412, 1.0000}, {0, 0.5176, 1.0000}, {0, 0.4941, 1.0000},
    {0, 0.4706, 1.0000}, {0, 0.4471, 1.0000}, {0, 0.4235, 1.0000},
    {0, 0.4000, 1.0000}, {0, 0.3765, 1.0000}, {0, 0.3529, 1.0000},
    {0, 0.3294, 1.0000}, {0, 0.3059, 1.0000}, {0, 0.2824, 1.0000},
    {0, 0.2588, 1.0000}, {0, 0.2353, 1.0000}, {0, 0.2118, 1.0000},
    {0, 0.1882, 1.0000}, {0, 0.1647, 1.0000}, {0, 0.1412, 1.0000},
    {0, 0.1176, 1.0000}, {0, 0.0941, 1.0000}, {0, 0.0706, 1.0000},
    {0, 0.0471, 1.0000}, {0, 0.0235, 1.0000}, {0, 0, 1.0000},
    {0.0235, 0, 1.0000}, {0.0471, 0, 1.0000}, {0.0706, 0, 1.0000},
    {0.0941, 0, 1.0000}, {0.1176, 0, 1.0000}, {0.1412, 0, 1.0000},
    {0.1647, 0, 1.0000}, {0.1882, 0, 1.0000}, {0.2118, 0, 1.0000},
    {0.2353, 0, 1.0000}, {0.2588, 0, 1.0000}, {0.2824, 0, 1.0000},
    {0.3059, 0, 1.0000}, {0.3294, 0, 1.0000}, {0.3529, 0, 1.0000},
    {0.3765, 0, 1.0000}, {0.4000, 0, 1.0000}, {0.4235, 0, 1.0000},
    {0.4471, 0, 1.0000}, {0.4706, 0, 1.0000}, {0.4941, 0, 1.0000},
    {0.5176, 0, 1.0000}, {0.5412, 0, 1.0000}, {0.5647, 0, 1.0000},
    {0.5882, 0, 1.0000}, {0.6118, 0, 1.0000}, {0.6353, 0, 1.0000},
    {0.6588, 0, 1.0000}, {0.6824, 0, 1.0000}, {0.7059, 0, 1.0000},
    {0.7294, 0, 1.0000}, {0.7529, 0, 1.0000}, {0.7765, 0, 1.0000},
    {0.8000, 0, 1.0000}, {0.8235, 0, 1.0000}, {0.8471, 0, 1.0000},
    {0.8706, 0, 1.0000}, {0.8941, 0, 1.0000}, {0.9176, 0, 1.0000},
    {0.9412, 0, 1.0000}, {0.9647, 0, 1.0000}, {0.9882, 0, 1.0000},
    {1.0000, 0, 0.9882}, {1.0000, 0, 0.9647}, {1.0000, 0, 0.9412},
    {1.0000, 0, 0.9176}, {1.0000, 0, 0.8941}, {1.0000, 0, 0.8706},
    {1.0000, 0, 0.8471}, {1.0000, 0, 0.8235}, {1.0000, 0, 0.8000},
    {1.0000, 0, 0.7765}, {1.0000, 0, 0.7529}, {1.0000, 0, 0.7294},
    {1.0000, 0, 0.7059}, {1.0000, 0, 0.6824}, {1.0000, 0, 0.6588},
    {1.0000, 0, 0.6353}, {1.0000, 0, 0.6118}, {1.0000, 0, 0.5882},
    {1.0000, 0, 0.5647}, {1.0000, 0, 0.5412}, {1.0000, 0, 0.5176},
    {1.0000, 0, 0.4941}, {1.0000, 0, 0.4706}, {1.0000, 0, 0.4471},
    {1.0000, 0, 0.4235}, {1.0000, 0, 0.4000}, {1.0000, 0, 0.3765},
    {1.0000, 0, 0.3529}, {1.0000, 0, 0.3294}, {1.0000, 0, 0.3059},
    {1.0000, 0, 0.2824}, {1.0000, 0, 0.2588}, {1.0000, 0, 0.2353},
    {1.0000, 0, 0.2118}, {1.0000, 0, 0.1882}, {1.0000, 0, 0.1647},
    {1.0000, 0, 0.1412}, {1.0000, 0, 0.1176}, {1.0000, 0, 0.0941},
    {1.0000, 0, 0.0706}, {1.0000, 0, 0.0471}, {1.0000, 0, 0.0235}};
static const double dissimilar_color_table[20][3] = {
    {0.8157, 0.8980, 0.2078}, {0.9412, 0.4314, 0.9176},
    {0.4000, 0.9059, 0.2549}, {0.8745, 0.5529, 0.9176},
    {0.6118, 0.8863, 0.2588}, {0.7059, 0.5569, 0.9412},
    {0.3255, 0.7608, 0.2941}, {0.9529, 0.4745, 0.6980},
    {0.3137, 0.9098, 0.5020}, {0.4314, 0.6157, 0.9686},
    {0.9020, 0.7804, 0.2157}, {0.2745, 0.8941, 0.7020},
    {0.9647, 0.5137, 0.3843}, {0.5765, 0.9255, 0.5412},
    {0.9216, 0.5765, 0.2078}, {0.4667, 0.7529, 0.4275},
    {0.8157, 0.6824, 0.2863}, {0.5451, 0.7255, 0.2588},
    {0.8000, 0.8745, 0.4471}, {0.6902, 0.7686, 0.2118}};
